<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Json {

    public function ok($result=null){
	    if(is_null($result)){
   		   return json_encode( array( 'status' => 'OK' ) );
		}
	    return json_encode( array( 'status' => 'OK', 'result' => $result ) );
	}
    public function fail($message = 'Server error'){
	    return json_encode( array( 'status' => 'FAIL', 'result' => array( 'message'=>$message) ) );
	}
}

?>